package com.ay.weixin.fdc.admin.customer.event;

import java.io.IOException;

import javax.servlet.ServletException;

import org.lizar.config.Config;
import org.lizar.controller.Event;
import org.lizar.controller.loader.EventLoader;
import org.lizar.util.StringHelper;

import com.ay.weixin.fdc.admin.superadmin.domain.SuperAdmin;

public class CustomerManage extends Event {

	@Override
	public void init_property() throws Exception {
		
		
	}

	@Override
	public String default_handling_path() {
		return "/admin/customer/*";
	}

	@Override
	public void handle(EventLoader el) throws ServletException, IOException {
		SuperAdmin adm=(SuperAdmin)el.getSessionAttr("adm");
		if(adm==null){
			el.response(Config.xpathgetStr("server_info.root")+"/superadmin/login/");
		}else{
			if(StringHelper.equals(el.queryPath(2), "")){
				index(el);
			}
		}
	}

	private void index(EventLoader el) throws IOException, ServletException{
		
		el.template("/WEB-INF/template/superadmin/customer/index.vm");
	}
	
}
